package com.study.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.study.model.dto.topic.TopicAddRequest;
import com.study.model.dto.topic.TopicQueryRequest;
import com.study.model.dto.topic.TopicUpdateRequest;
import com.study.model.entity.Topic;
import com.baomidou.mybatisplus.extension.service.IService;
import com.study.model.vo.TopicVO;

import javax.servlet.http.HttpServletRequest;

/**
* @author YS
* @description 针对表【topic(话题)】的数据库操作Service
* @createDate 2025-02-18 14:31:12
*/
public interface TopicService extends IService<Topic> {

    /**
     * 创建话题
     * @param topicAddRequest
     * @param request
     * @return
     */
    Long createLearningNote(TopicAddRequest topicAddRequest, HttpServletRequest request);

    /**
     * 根据id查询话题包装类
     *
     * @param id
     * @return
     */
    TopicVO getTopicVOById(long id);

    /**
     * 更新话题
     *
     * @param topicUpdateRequest
     * @return
     */
    Boolean updateTopic(TopicUpdateRequest topicUpdateRequest);

    /**
     * 分页获取话题封装类
     *
     * @param topicQueryRequest
     * @return
     */
    Page<TopicVO> listTopicVOByPage(TopicQueryRequest topicQueryRequest);

    /**
     * 获取话题分页QueryWrapper
     * @param topicQueryRequest
     * @return
     */
    QueryWrapper<Topic> getQueryWrapper(TopicQueryRequest topicQueryRequest);
}
